package model

import "time"

const SysNodeContractTable = "node_contract"

type SysNodeContract struct {
	Id                   int       `json:"id" gorm:"primaryKey;autoIncrement;column:id"`
	CurrentBlock         uint64    `json:"id" gorm:"column:current_block"`                              // 当前区块高度
	ConsensusNo          uint64    `json:"consensus_no" gorm:"column:consensus_no"`                     // 共识周期轮次
	Epoch                uint64    `json:"epoch" gorm:"column:epoch"`                                   // 结算周期轮次
	NodePrimaryId        int       `json:"node_primary_id" gorm:"column:node_primary_id"`               // 节点ID-节点表ID
	NodeId               string    `json:"node_id" gorm:"column:node_id"`                               // 节点ID-地址
	NodeName             string    `json:"node_name" gorm:"column:node_name"`                           // 节点名称
	StakingAddr          string    `json:"staking_addr" gorm:"column:staking_addr"`                     // 质押地址
	StakingAddrAccount   float64   `json:"staking_addr_account" gorm:"column:staking_addr_account"`     // 质押地址余额
	StakingReward        float64   `json:"staking_reward" gorm:"column:staking_reward"`                 // 总质押奖励
	MiningReward         float64   `json:"mining_reward" gorm:"column:mining_reward"`                   // 总出块奖励
	DelegationReward     float64   `json:"delegation_reward" gorm:"column:delegation_reward"`           // 总委托奖励
	BenefitAddr          string    `json:"benefit_addr" gorm:"column:benefit_addr"`                     // 收益地址
	BenefitAddrAccount   float64   `json:"benefit_addr_account" gorm:"column:benefit_addr_account"`     // 收益地址余额
	BonusRatio           uint16    `json:"bonus_ratio" gorm:"column:bonus_ratio"`                       // 分红比例
	DelegatorSum         int       `json:"delegator_sum" gorm:"column:delegator_sum"`                   // 委托人数
	StakingSum           float64   `json:"staking_sum" gorm:"column:staking_sum"`                       // 节点质押量
	DelegationSum        float64   `json:"delegation_sum" gorm:"column:delegation_sum"`                 // 节点委托量
	TotalReward          float64   `json:"total_reward" gorm:"column:total_reward"`                     // 总收益
	TotalBalance         float64   `json:"total_balance" gorm:"column:total_balance"`                   // 总资产
	DelegationNotReceive float64   `json:"delegation_not_receive" gorm:"column:delegation_not_receive"` // 待领取委托奖励
	CurrentBlockingNode  string    `json:"current_blocking_node" gorm:"column:current_blocking_node"`   // 当前正出块节点
	Status               int       `json:"status" gorm:"column:status"`                                 // 节点状态
	NextPeriod           uint64    `json:"next_period" gorm:"column:next_period"`                       // 下个结算周期
	CreateTime           time.Time `json:"create_time" gorm:"column:create_time"`
	UpdateTime           time.Time `json:"update_time" gorm:"column:update_time"`
}
